package com.zwt.utils.spring;

import org.springframework.web.context.ContextLoaderListener;

import javax.servlet.ServletContextEvent;

/**
 * Created by hello on 2017/11/6.
 */
public class WebContextListener extends ContextLoaderListener {
    @Override
    public void contextInitialized(ServletContextEvent event) {
        try {
            super.contextInitialized(event);
            SpringContextUtil.setApplicationContext(getCurrentWebApplicationContext());
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
